<?php
/*------------------------------------------------------+
| PHP-Fusion Content Management System                  |
| Copyright (C) 2002 - 2010 Nick Jones                  |
| http://www.php-fusion.co.uk/                          |
+-------------------------------------------------------+
| This program is released as free software under the   |
| Affero GPL license. You can redistribute it and/or    |
| addonify it under the terms of this license which you |
| can read by viewing the included agpl.txt or online   |
| at www.gnu.org/licenses/agpl.html. Removal of this    |
| copyright header is strictly prohibited without       |
| written permission from the original author(s).       |
+------------------------------------------------------*/
/*------------------------------------------------------+
|     Theme Orangeknas for PHP-Fusion v7                |
+-------------------------------------------------------+
| Filename: theme.php                                   |
| author: Assensvej/Kenneth Christensen                 |
| Homepage: http://www.assensvej.dk/                    |
+-------------------------------------------------------+
| Original design by: joomlatutorials.dk                |
| Homepage:  http://www.joomlatutorials.dk              |
+-------------------------------------------------------+
| This theme is released under the terms and conditions |
| of the GNU Affero GPL v3.                             |
+------------------------------------------------------*/


if (!defined("IN_FUSION")) { die("Access Denied"); }

// Theme Settings
define("THEME_BULLET", "<img src='".THEME."images/bullet.gif' alt='' style='border:0' />");
require_once INCLUDES."theme_functions_include.php";

function render_page($license=false) {

global $theme_width,$settings;
$theme_width = 1000;

echo "
  <table align='center' cellspacing='0' cellpadding='0' class='outer-border' id='main'>
    <tr>
      <td>
        <table align='center' cellpadding='0' cellspacing='0' width='$theme_width'>
          <tr>
            <td class='full-header'>
              <table cellpadding='0' cellspacing='0' width='900'>
                <tr>
                  <td>".showbanners()."</td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
        <table align='center' cellpadding='0' cellspacing='0' width='$theme_width'>
		  <tr>
            <td class='sub-header'>".showsublinks(" <span class='bullet'>&middot;</span> ", "white")."</td>
            <td align='right' class='sub-header'>".showsubdate()."</td>
          </tr>
        </table>\n";

echo "
        <table align='center' cellpadding='0' cellspacing='0' width='$theme_width'>
		  <tr>\n";
		    if (LEFT) { echo "<td class='side-border-left' valign='top'>".LEFT."</td>"; }
            echo "<td class='main-bg' valign='top'>".U_CENTER.CONTENT.L_CENTER."</td>";
            if (RIGHT) { echo "<td class='side-border-right' valign='top'>".RIGHT."</td>"; }
			
echo "
          </tr>
		</table>
    <table align='center' border='0' cellpadding='0' cellspacing='0' width='$theme_width'>
	<tr>
	<td>".stripslashes($settings['footer'])."<br />
	<table border='0' cellpadding='0' cellspacing='0' width='100%' style='height: 30px'>
	<tr><td class='footer' valign='middle' width='35%'>\n";
	echo showcopyright()."<br />
	</td>
	<td class='footer' align='center' width='22%'>\n";
	echo "<span class='stats'>Orangeknas</span> Theme by: <a href='http://www.assensvej.dk/7/'>Assensvej.dk</a><br /><span class='stats'>Original design by:</span> Theme by: <a href='http://www.joomlatutorials.dk/'>joomlatutorials.dk</a>
	</td>
	<td class='footer' align='right' width='33%'>\n";
	echo showcounter()."<br />
	            </td>
	          </tr>
	        </table>
	      </td>
	    </tr>
	  </table>
    </td>
  </tr>
</table>\n";
echo "<div style='position:relative;'><a href='news.php'><img src='".THEME."images/Page-BgGlare.png' border='0' alt='' title='' style='position:absolute;top:-1100px;left:0px;' /></a>
</div>";
}

function render_news($subject, $news, $info) {

echo "<table cellpadding='0' cellspacing='0' width='100%' class='border tablebreak'>
<tr>
<td class='capmain'>$subject</td>
</tr>
<tr>
<td class='main-body'>$news</td>
</tr>
<tr>
<td align='center' class='news-footer'>\n";
echo newsposter($info," &middot;").newsopts($info,"&middot;").itemoptions("N",$info['news_id']);
echo "</td>
</tr>
</table>\n";

}

function render_article($subject, $article, $info) {
	
echo "<table width='100%' cellpadding='0' cellspacing='0' class='border'>
<tr>
<td class='capmain'>$subject</td>
</tr>
<tr>
<td class='main-body'>
".($info['article_breaks'] == "y" ? nl2br($article) : $article)."
</td>
</tr>
<tr>
<td align='center' class='news-footer'>\n";
echo articleposter($info," &middot;").articleopts($info,"&middot;").itemoptions("A",$info['article_id']);
echo "</td>
</tr>
</table>\n";

}

function opentable($title) {

echo "<table cellpadding='0' cellspacing='0' width='100%' class='border tablebreak'>
<tr>
<td class='capmain'>$title</td>
</tr>
<tr>
<td class='main-body'>\n";

}

function closetable() {

echo "</td>
</tr>
</table>\n";

}

function openside($title, $collapse = false, $state = "on") {

global $panel_collapse; $panel_collapse = $collapse;
$boxname = str_replace(" ", "", $title);

echo "
<table cellpadding='0' cellspacing='0' width='100%' class='border tablebreak'>
  <tr>
    <td class='scapmain'>$title</td>
    ".($collapse ? "<td class='scapmain' align='right'>".panelbutton($state, $boxname)."</td>" : "")."
  </tr>
  <tr>
    <td colspan='2' class='side-body'>";
    if ($collapse == true) { echo panelstate($state, $boxname); }
}

function closeside() {

global $panel_collapse;

if ($panel_collapse == true) { echo "</div>\n"; }

echo "</td>
</tr>
</table>\n";

}

?>